import requests
import json

cookies = {
    'eas_sid': 'D1f7N5H1E0S0l5D7t2j6X9c3D1',
    'pgv_pvid': '7340284041',
    '_qimei_uuid42': '1961b0e1c311007908ffbf2a1ed4f7c512d4a5ba22',
    '_qimei_fingerprint': '024e5e157296647aae0bf27b97869808',
    '_qimei_q36': '',
    '_qimei_h38': 'fdedb73808ffbf2a1ed4f7c50200000f31961b',
    'fqm_pvqid': 'c990a6c4-8b34-4adc-98d6-cd1faa788091',
    'RK': '2c0J5eU/SS',
    'ptcz': '5c0eed13b2c008cfff205882f722c266581d23b63ba0510567897f6ecb124c92',
    'pgv_info': 'ssid=s3557241178',
    'cfmqqcomrouteLine': 'a20210425jjltzt_a20200225s2_versionList_versionList',
}

headers = {
    'accept': '*/*',
    'accept-language': 'zh-CN,zh;q=0.9,en-US;q=0.8,en;q=0.7',
    'cache-control': 'no-cache',
    'pragma': 'no-cache',
    'referer': 'https://cfm.qq.com/',
    'sec-ch-ua': '"Chromium";v="140", "Not=A?Brand";v="24", "Google Chrome";v="140"',
    'sec-ch-ua-mobile': '?0',
    'sec-ch-ua-platform': '"Windows"',
    'sec-fetch-dest': 'script',
    'sec-fetch-mode': 'no-cors',
    'sec-fetch-site': 'same-site',
    'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Safari/537.36',
}

params = {
    'p0': '34',
    'p1': 'searchNewsKeywordsList',
    'page': '2',
    'pagesize': '18',
    'order': 'sIdxTime',
    'r0': 'script',
    'r1': 'NewsObj37257760316489497',
    'type': 'iType',
    'id': '1412',
    'source': '',
}

response = requests.get('https://apps.game.qq.com/wmp/v3.1/?p0=34&p1=searchNewsKeywordsList&page=1&pagesize=18', params=params, cookies=cookies, headers=headers)
datas = response.text[len('var NewsObj37257760316489497='):-1]
datas = json.dumps(json.loads(datas), indent=4, ensure_ascii=False)
print(datas)